var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, e, o, n) {
    var i, a = arguments.length, c = a < 3 ? e : null === n ? n = Object.getOwnPropertyDescriptor(e, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(t, e, o, n); else for (var r = t.length - 1; 0 <= r; r--) (i = t[r]) && (c = (a < 3 ? i(c) : 3 < a ? i(e, o, c) : i(e, o)) || c);
    return 3 < a && c && Object.defineProperty(e, o, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("PrefabView"), s = e("AuthManager"), c = e("Global"), l = e("GameConfig"), d = e("GameData"), u = e("DataManager"), p = e("WebManager"), h = e("UIManager"), f = cc._decorator, g = f.ccclass, m = f.property, y = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.hint = null, t.auth = null, t.authNode = null, t.closeNode = null, t.infoLabel = null, 
        t.msgLabel = null, t.nameEdit = null, t.idcardEdit = null, t.isQuit = !1, t;
    }
    return i(t, e), t.prototype.onLoad = function() {
        -1 < l.GC.authBeforeTime ? s.default.getInstance().doCheck() ? this.infoLabel.string = "你当前为游客账号，根据国家相关规定，游客账号享有" + Math.round(l.GC.authBeforeTime / 60) + "分钟游戏体验时间。登记实名信息后可深度体验。" : this.showQuit() : this.infoLabel.string = "你当前为游客账号，根据国家相关规定，游客账号享有60分钟游戏体验时间。登记实名信息后可深度体验。";
    }, t.prototype.onClickAuth = function() {
        this.showAuth();
    }, t.prototype.onClickClose = function() {
        this.isQuit ? cc.game.end() : this.hidePnl();
    }, t.prototype.onClickDoAuth = function() {
        this.doAuth();
    }, t.prototype.start = function() {}, t.prototype.showHint = function() {
        this.hint.active = !0, this.auth.active = !1;
    }, t.prototype.showAuth = function() {
        this.hint.active = !1, this.auth.active = !0;
    }, t.prototype.showQuit = function() {
        this.isQuit = !0, this.infoLabel.string = "由于你未填写实名认证，\n按照国家规定" + l.GC.authDay + "天能体验时间" + Math.round(l.GC.authBeforeTime / 60) + " 分钟，\n您目前已超时体验；\n\n提示：年满18周岁用户完成实名后将不受限制；", 
        this.closeNode.active = !1, this.authNode.y = -100;
    }, t.prototype.doAuth = function() {
        var e = this;
        p.default.getInstance().reqAuth({
            name: this.nameEdit.textLabel.string,
            idcard: this.idcardEdit.textLabel.string,
            success: function(t) {
                0 == t.data.code ? (e.msgLabel.node.active = !1, c.G.age = t.data.data.age, s.default.getInstance().isAuth = 18 <= c.G.age, 
                cc.systemEvent.emit("finishAuth"), d.GD.updateNumber("diamond", 500), h.default.getInstance().showToast({
                    diamond: 500
                }), u.default.getInstance().save(), e.hidePnl()) : 11 == t.data.code && (e.msgLabel.node.active = !0);
            }
        });
    }, a([ m(cc.Node) ], t.prototype, "hint", void 0), a([ m(cc.Node) ], t.prototype, "auth", void 0), 
    a([ m(cc.Node) ], t.prototype, "authNode", void 0), a([ m(cc.Node) ], t.prototype, "closeNode", void 0), 
    a([ m(cc.Label) ], t.prototype, "infoLabel", void 0), a([ m(cc.Label) ], t.prototype, "msgLabel", void 0), 
    a([ m(cc.EditBox) ], t.prototype, "nameEdit", void 0), a([ m(cc.EditBox) ], t.prototype, "idcardEdit", void 0), 
    a([ g ], t);
}(r.default);

n.default = y;